-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: move packages to workspace vitest #3551
Conversation
|
because vitest global setup starts anvil at a specific port
This reverts commit 61d08ac.
93a643d
to
9bd27a9
Compare
Although #3526 fixes one instance of running tests from workspace root or in a package, it breaks down once we add more packages and parallelism. The source of this issue steps from the fact that the thing running Vitest (and thus starting up Anvil) is parallelized, rather than letting Vitest do the parallelizing.
To work around this, I made a
with-anvil
CLI wrapper that 1) starts up Anvil before starting the inner command and 2) passes the Anvil URL to the inner command via env var.The downside is you have to remember to run
with-anvil
if you want to run Anvil tests from outside the context of the workspace root. But I left a nice warning to guide you to the right thing, making it easy to copy+paste and move on:mud/test/with-anvil/src/getAnvilRpcUrl.ts
Lines 6 to 15 in 399afe0
Snapshots got updated because newer Vitest changed their snapshot formatting (mostly reduces escaping).
closes #2409